package com.ruoyi.wx.controller;


import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.model.LoginBody;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.wx.service.IEmployeeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/wx/login")
public class EmployeeLoginController {

    @Autowired
    private IEmployeeService employeeService;


    @GetMapping("/userinfo")
    public AjaxResult getUserInfo(){
        // 获取当前登录的用户信息
        LoginUser loginUser = SecurityUtils.getLoginUser();
        log.info("当前登录的用户信息：{}", loginUser);

        return AjaxResult.success(employeeService.getUserInfo(loginUser.getUserId()));
    }




}
